package cz.vargagab.mvc;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import cz.vargagab.repo.InternalServerService;

@Controller
public class LogReportController extends AbstractController{
	 
	@Autowired
	InternalServerService internalServerService;

	@Override
	@RequestMapping("/report")
	protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
		return new ModelAndView("pdfView","logs",internalServerService.getLog());
	}

	 //Getters & Setters
	public InternalServerService getInternalServerService() {
		return internalServerService;
	}
	public void setInternalServerService(InternalServerService internalServerService) {
		this.internalServerService = internalServerService;
	}	
	
}